<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function delChar(str1, str2) {
        let r = "";
        for (let v of str1) {
          // if (v !== str2) {
          if (str2.includes(v) === false) {
            r += v;
          }
        }
        return r;
      }

      console.log("abcd", delChar("abcd", "bd"));
    </script>
  </body>
</html>
